package com.whpost.service.dao.cwqf;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.whpost.service.entity.cwqf.TCwqfKhzf;
import com.whpost.service.entity.cwqf.TCwqfTeam;
import org.apache.ibatis.annotations.*;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author YinZhuoyi
 * @since 2025-08-29
 */
public interface TCwqfTeamMapper extends BaseMapper<TCwqfTeam> {

    @Select("select * from t_cwqf_team where ${ew.sqlSegment}")
    @Results(id="tCwqfTeamMap",value = {
            @Result(column="ssjg_id",property="ssjg",
                    one=@One(
                            select="com.whpost.service.dao.cwqf.HsJgMapper.selectById")
            ),
            @Result(column="lrjg",property="hsJg",
                    one=@One(
                            select="com.whpost.service.dao.cwqf.HsJgMapper.selectById")
            ),
            @Result(column="lrry",property="lrCzy",
                    one=@One(
                            select="com.whpost.service.dao.cwqf.HsCzyMapper.selectByCode")
            ),
            @Result(column="lrry",property="lrry"),
            @Result(column="lrjg",property="lrjg"),
            @Result(column="ssjg_id",property="ssjgId")
    })
    IPage<TCwqfTeam> getTCwqfTeamPage(Page<TCwqfTeam> page, @Param("ew") QueryWrapper wrapper);

    @Select("select * from t_cwqf_team where id=#{id}")
    @ResultMap(value="tCwqfTeamMap")
    TCwqfTeam getTCwqfTeamById(@Param("id") Long id);
}
